package Interceptor;

import builder.RequestBuilder;
import builder.ResponseBuilder;
import request.RequestBody;

public class RequestInterceptor implements  RequestInterceptorActionInterface{

private  RequestInterceptor requestInterceptor;
	
	public RequestInterceptor setRequestInterceptor(RequestInterceptor requestInterceptor) {
		if(this.requestInterceptor==null)
		this.requestInterceptor = requestInterceptor;
		else this.requestInterceptor.setRequestInterceptor(requestInterceptor);
		return requestInterceptor;
	}

	public RequestBuilder interceptor(RequestBuilder builder) throws Exception {
		if (requestInterceptor != null) {
			builder= requestInterceptor.interceptor(builder);
 		 }
 
		
		return interceptorAction(builder);
	}
	
	
	public  RequestBuilder interceptorAction(RequestBuilder builder) throws Exception{
		
		return builder;
	}
	
}
